package com.cvit.weixin;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;

import com.cvit.dao.OrdersMapper;
import com.cvit.service.OrdersService;


/**
 * 订单工具类
 * @author 
 * 
 */
public class OrderUtils {
	@Autowired
	static
	OrdersService ordersService;
	/*public static String genOrderNo(){
		String orderNo = "06";
		SimpleDateFormat sdf=new SimpleDateFormat("yyMMddhhmmss");
		String nowTime = sdf.format(new Date());
		orderNo+=nowTime;
		return orderNo;
	}*/
	public static String genOrderNo(){
		String id=null;
		int i=0;
		for(;i==0;){
			String orderNo = "06";
			SimpleDateFormat sdf=new SimpleDateFormat("yyMMddhhmmss");
			String nowTime = sdf.format(new Date());
			orderNo+=nowTime;
			id = orderNo;
//			if(ordersService(id)==null){
//				i=1;
//			}
		}
		return id;
	}
}
